
const { writeFile, accessFile } = require('./File');
const help = require("./help");
const processFn = require('./process');

const setGraphics = async (name) => {
    try {
        await accessFile(`../figure/${name}.txt`);
        await writeFile('../data/graphics.txt', name);
        processFn('Graphics set successfully');
    } catch (err) {
        switch (err.errno) {
            case -2:
                help();
                break
            default:
                console.log(err);
        }
    }
}

module.exports = {
    setGraphics
}
